﻿<sap:ActivityDesigner x:Class="BioWF.Activities.Design.IterativeAssemblerDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:interactivity="http://www.julmar.com/wpfhelpers"
    xmlns:converters="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
    xmlns:collections="clr-namespace:System.Collections.Generic;assembly=mscorlib" 
    xmlns:extensions="clr-namespace:BioWF.Activities.Design.Extensions"
    xmlns:bio="clr-namespace:Bio;assembly=Bio">
    
    <sap:ActivityDesigner.Icon>
        <DrawingBrush>
            <DrawingBrush.Drawing>
                <ImageDrawing>
                    <ImageDrawing.Rect>
                        <Rect Location="0,0" Size="16,16" ></Rect>
                    </ImageDrawing.Rect>
                    <ImageDrawing.ImageSource>
                        <BitmapImage UriSource="Images/assembly.png" />
                    </ImageDrawing.ImageSource>
                </ImageDrawing>
            </DrawingBrush.Drawing>
        </DrawingBrush>
    </sap:ActivityDesigner.Icon>

    <StackPanel>
        <StackPanel.Resources>
            <converters:ArgumentToExpressionConverter x:Key="argToExpression" />
            <Style TargetType="TextBlock">
                <Setter Property="FontWeight" Value="Bold" />
                <Setter Property="Margin" Value="5" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>
        </StackPanel.Resources>

        <TextBlock Text="Input sequences to assemble" />
        <sapv:ExpressionTextBox Margin="5" 
                                    OwnerActivity="{Binding ModelItem}"
                                    HintText="List of sequences to save"
                                    Expression="{Binding ModelItem.Sequences, Mode=TwoWay, Converter={StaticResource argToExpression}, ConverterParameter=In}">
            <sapv:ExpressionTextBox.ExpressionType>
                <extensions:Generic BaseType="{x:Type collections:IEnumerable`1}"
                                    InnerType="{x:Type bio:ISequence}" />
            </sapv:ExpressionTextBox.ExpressionType>
        </sapv:ExpressionTextBox>

        <TextBlock Text="Sequence Aligner" />
        <ComboBox x:Name="cbAligners" Margin="5"
                  SelectedItem="{Binding ModelItem.AlignerName, Mode=TwoWay}" />

        <TextBlock Text="Similarity Matrix" />
        <ComboBox x:Name="cbMatrices" Margin="5"
                  SelectedItem="{Binding ModelItem.SimilarityMatrix, Mode=TwoWay}"/>

        <TextBlock Text="Match Score (used only for Diagonal Similarity Matrix)" />
        <TextBox x:Name="tbMatchScore" Margin="5" Text="{Binding ModelItem.MatchScore, Mode=TwoWay}">
            <i:Interaction.Behaviors>
                <interactivity:NumericTextBoxBehavior Minimum="-200" Maximum="200" />
            </i:Interaction.Behaviors>
        </TextBox>

        <TextBlock Text="Mismatch Score (used only for Diagonal Similarity Matrix)" />
        <TextBox x:Name="tbMismatchScore" Margin="5" Text="{Binding ModelItem.MismatchScore, Mode=TwoWay}">
            <i:Interaction.Behaviors>
                <interactivity:NumericTextBoxBehavior Minimum="-200" Maximum="200" />
            </i:Interaction.Behaviors>
        </TextBox>

        <TextBlock Text="Gap Open Cost" />
        <TextBox Margin="5" Text="{Binding ModelItem.GapOpenCost, Mode=TwoWay}">
            <i:Interaction.Behaviors>
                <interactivity:NumericTextBoxBehavior Minimum="-200" Maximum="200" />
            </i:Interaction.Behaviors>
        </TextBox>

        <TextBlock Text="Gap Extension Cost (zero to ignore)" />
        <TextBox Margin="5" Text="{Binding ModelItem.GapExtensionCost, Mode=TwoWay}">
            <i:Interaction.Behaviors>
                <interactivity:NumericTextBoxBehavior Minimum="-200" Maximum="200" />
            </i:Interaction.Behaviors>
        </TextBox>

        <CheckBox Margin="5" IsChecked="{Binding ModelItem.AssumeStandardOrientation, Mode=TwoWay}"
                  FontWeight="Bold" Content="Assume Standard Orientation (5' to 3')"/>

    </StackPanel>
</sap:ActivityDesigner>
